import router from '@/router/index'

export default (Vue) => {
  router.beforeEach(async (to, from, next) => {
    document.title = to.meta.title
    // 判断是否是微信环境
    if (/MicroMessenger/i.test(window.navigator.userAgent)) {
      // 判断安卓还是ios环境,记录ios进入页面第一个路径值用于微信config鉴权
      if (!Vue.prototype.signLink || /(Android)/i.test(navigator.userAgent)) {
        Vue.prototype.signLink = location.href
      }
    }
    next()
  })

  router.afterEach(() => {

  })
}
